/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exercises.day01.pt1;

import java.text.DecimalFormat;
import java.util.Scanner;

/**
 * MyFirstJava
 *
 * @author (jaice)
 * @version 0.1 (may 28, 2012)
 * 
 * a. Write a program that calculates and displays the number of US Dollars, 
*Japanese Yen, and European euro equivalent to a given number of peso.  Use the 
*current currency exhange rates (http://www.xe.com/ucc/).
 * 
 */
public class CurrencyConverter {

    public static void main(String args[]) {
        //declare variable
        double peso = 0;
        double yen =  1.81545 ;
        double usDollar = 0.0229338 ;
        double euro = 0.0182139;
        
        //for rounding off two decimal places
        DecimalFormat twoDForm = new DecimalFormat("#.##");
            
        //declare scanner
        Scanner sc = new Scanner(System.in);

        //print input amt
        System.out.println("Input amount in peso ");

        //get input
        peso = sc.nextDouble();

        //print us dollar conversion
        System.out.println("Amount in US dollars is  " +Float.valueOf(twoDForm.format( peso * usDollar)) );
        
        //print european euro conversion
        System.out.println("Amount in European euro is  " +Float.valueOf(twoDForm.format( peso * euro)) );
        
        //print japanese yen conversion
        System.out.println("Amount in Japanese yen is  " + Float.valueOf(twoDForm.format( peso * yen)) );





    }
}
